想了解如何取得滑鼠滾輪事件並相容不同瀏覽器可以參考
function MouseWheel (e) {
e = e || window.event;
alert(['scrolled ', (( e.wheelDelta <= 0 || e.detail > 0) ? 'down' : 'up')].join(''));
}
// hook event listener on window object
if ('onmousewheel' in window) {
window.onmousewheel = MouseWheel;
} else if ('onmousewheel' in document) {
document.onmousewheel = MouseWheel;
} else if ('addEventListener' in window) {
window.addEventListener("mousewheel", MouseWheel, false);
window.addEventListener("DOMMouseScroll", MouseWheel, false);
}
Demo: http://jsfiddle.net/pKLVf/